<?php 

    $con=mysql_connect("localhost","root","1234");
    mysql_query("set names utf8");
    mysql_select_db("sql");
    $oldname=$_GET["oldname"];

    $oldmima=$_GET["oldmima"];
    $xinmima1=$_GET["xinmima1"];
    $xinmima1=$_GET["xinmima2"];
    $sql="select * from userinfo where user='$oldname' and pwd='$oldmima'";
    $r=mysql_query($sql,$con);
    $rows=mysql_fetch_array($r);
    if($rows['user']){
    	if($oldmima1==$oldmima2){
 $sql="update userinfo set pwd='$oldmima1' where user='$oldname'";
    $r=mysql_query($sql,$con); 
 
    if($r)
   {
   	include('mima.html');
   }else{

   	include('mima.html');

   }

        }else{
        	echo "两次密码输入不同";
        }

        }else{
	echo "密码验证失败";
         }
    
   


?>